home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-02-20 | 5.3 KB | 197 lines | [TEXT/MMCC] |
- // *****************************************************************************
- //
- // WindoidDraw.h
- //
- // —————————————————————————————————————————————————————————————————————————————
- // Copyright © 1991-95 Infinity Systems. All rights reserved.
- // —————————————————————————————————————————————————————————————————————————————
- #ifndef Infinity_WINDOIDDRAW
- #define Infinity_WINDOIDDRAW
-
- #include "WindoidDefines.h"
-
- #include <Fonts.h>
- #include <Types.h>
- #include <Windows.h>
-
-
- // *****************************************************************************
- //
- // Constants
- //
- // *****************************************************************************
-
- // —————————————————————————————————————————————————————————————————————————————
- //
- // Titlebar and gadget sizes and offsets
- //
- // —————————————————————————————————————————————————————————————————————————————
- enum {
- kTingeInset = 1, // When insetting to adjust for window sides.
-
- #if qApple75Design
- kTitleHeight = 15, // Height of the windoid’s titlebar.
- kTitleVDelta = 3, // Height of baseline from bottom of titlebar.
- kGadgetMargin = 4, // Space between edge and gadget.
- kGadgetHitFudge = 0 // Slop area around gadgets for hit testing.
-
- #else
- kTitleHeight = 13,
- kTitleVDelta = 2,
- kGadgetMargin = 8,
- kGadgetHitFudge = 1
-
- #endif
- };
-
- #define kGadgetInset (2 + kTingeInset) // Inset from top/bottom of titlebar.
- #define kGadgetSize (kTitleHeight - (2 * kGadgetInset))
-
-
- // —————————————————————————————————————————————————————————————————————————————
- //
- // Scroll Bar width
- //
- // —————————————————————————————————————————————————————————————————————————————
- enum {
- #if qApple75Design
- kScrollBarPixels = 15
-
- #elif qSmallGrow
- kScrollBarPixels = 13
-
- #else
- kScrollBarPixels = 16
- #endif
- };
-
-
- // —————————————————————————————————————————————————————————————————————————————
- //
- // Font information for titlebar title
- //
- // —————————————————————————————————————————————————————————————————————————————
- enum {
- kTitleFont = applFont,
- kTitleSize = 9,
-
- #if qApple75Design
- kTitleStyle = 0, // Plain.
- kTitleMargin = 4 // Space between pattern and edges of text.
-
- #else
- kTitleStyle = bold,
- kTitleMargin = 5 // Space between pattern and edges of text.
- #endif
- };
-
-
- // —————————————————————————————————————————————————————————————————————————————
- //
- // Color table tinge percentage constants
- //
- // —————————————————————————————————————————————————————————————————————————————
- enum {
- wTitleBarLightPct = 0x1,
- wTitleBarTingeDarkPct = 0x4,
-
- #if qApple75Design
- wCloseBoxColor = 0x4, // the area is larger, so the gray is lighter
- wTitleBarDarkPct = 0xC, // dots are more dispersed, so darker
- wXedBoxPct = 0x0,
-
- #else
- wCloseBoxColor = 0x5,
- wTitleBarDarkPct = 0x8,
- wXedBoxPct = 0x8,
- #endif
-
- wGrowBoxBackground = 0x1,
- wGrowBoxColorLt = 0x4,
- wGrowBoxColorDk = 0x5,
-
- wInactiveFramePct = 0xA,
- wInactiveTextPct = 0x7
- };
-
-
- // —————————————————————————————————————————————————————————————————————————————
- //
- // Color table constants
- //
- // —————————————————————————————————————————————————————————————————————————————
- // These are the constants defined in the Apple technical note regarding
- // Color, Windows, and System 7. Last I checked, they weren't in an Apple
- // header file. (But the ones < 5 are, from the previous, pre-System 7
- // coloring scheme.)
- // —————————————————————————————————————————————————————————————————————————————
- enum {
- wHiliteColorLight = 5,
- wHiliteColorDark,
- wTitleBarLight,
- wTitleBarDark,
- wDialogLight,
- wDialogDark,
- wTingeLight,
- wTingeDark
- };
-
-
- // *****************************************************************************
- //
- // Prototypes
- //
- // *****************************************************************************
-
- // —————————————————————————————————————————————————————————————————————————————
- //
- // Part rectangles
- //
- // —————————————————————————————————————————————————————————————————————————————
- void GetTitleBarRect(WindowPeek window, Rect *titleBar);
-
- void GetCloseBox(WindowPeek window, Rect *theRect);
-
- void GetZoomBox(WindowPeek window, Rect *theRect);
-
- void GetGrowBox(WindowPeek window, Rect *theRect);
-
-
- // —————————————————————————————————————————————————————————————————————————————
- //
- // Coloring
- //
- // —————————————————————————————————————————————————————————————————————————————
- void SetWFrameColor(WindowPeek window, Boolean isColor);
-
- void SetWTitleColor(WindowPeek window, Boolean isColor);
-
- void SetWTitleBarColors(WindowPeek window, Boolean isColor);
-
- void SetGadgetFrameEraseColors(WindowPeek window, Boolean isColor);
-
-
- // —————————————————————————————————————————————————————————————————————————————
- //
- // Part drawing
- //
- // —————————————————————————————————————————————————————————————————————————————
- void DrawCloseBox(WindowPeek window, Boolean isColor, const Rect *theRect);
-
- void DrawZoomBox(WindowPeek window, Boolean isColor, const Rect *theRect);
-
- void DrawXedBox(WindowPeek window, Boolean isColor, const Rect *theRect);
-
- void DrawGrowBox(WindowPeek window, Boolean isColor);
-
- void ToggleCloseBox(WindowPeek window, Boolean isColor);
-
- void ToggleZoomBox(WindowPeek window, Boolean isColor);
-
- void DrawTitleBar(WindowPeek window, Boolean isColor);
-
- void DrawWindowFrame(WindowPeek window, Boolean isColor);
-
-
- // —————————————————————————————————————————————————————————————————————————————
- #endif